{include file="style.tpl" }
{assign var="nb" value="0" scope="global"}
{assign var="nbOwner" value="0" scope="global"}
{assign var="nbAdviser" value="0" scope="global"}

{foreach $project.allTopics as $topic}
	{$nb=$nb+1}
	{if $topic.owner_validation eq 'y' or $topic.owner_validation eq 'i'}
		{$nbOwner=$nbOwner + 1}
	{/if}
	{if $topic.adviser_validation eq 'y' or $topic.adviser_validation eq 'i'}
		{$nbAdviser=$nbAdviser + 1}
	{/if}
{/foreach}
<page style="font-size: 10pt; font-family: arial;" backleft="10mm" backright="10mm" backtop="10mm" backbottom="10mm"> 
	{include file="page_footer.tpl"}
	{include file="header.tpl" title="Bilan du projet au {$smarty.now|date_format:'%d %B %Y'}"}
	
	<table style="width:190mm;" align="center" cellspacing="center" cellpadding="center">
		<tr>
			<td style="width:84mm;"  class="done">
				<h2>Description du projet : </h2><div class="detail">
				{if isset($project.description) gt 0 and trim($project.description) != ''}
					{$project.description}
					<br /><br />
				{/if}</div> 
			</td>
			<td style="width:2mm;">&nbsp;</td>
			<td style="width:84mm;" class="done">
				Nombre total d'items &agrave; valider : {$nb}<br /><br />
				Nombre d'items validés par le porteur : {$nbOwner}<br /><br />
				Nombre d'items validés par le conseiller : {$nbAdviser} 
			</td>
		</tr>
	</table>
	<br />
	<h2>Avancement du projet : points validés pendant l’accompagnement</h2><br />
	<table border="0" cellspacing="0">
	<thead>
	<tr>
		<th style='width:30mm;text-align:center;background-color:blue; color:white;'>Date</th>
		<th style='width:125mm;text-align:center;background-color:blue; color:white;'>Objectifs</th>
		<th style='width:30mm;text-align:center;background-color:blue; color:white;'>Validation C(onseiller) et/ou P(orteur)</th>
	</tr>
	</thead>
	<tr>
		<td style="border: 1px solid blue;text-align:center; color: blue; font-weight:bold;" colspan="3">
		Items validés uniquement par le porteur.
		</td>
	</tr>
	{foreach $project.allTopics as $topic}
		{if $topic.owner_validation eq 'y' or $topic.owner_validation eq 'i'}
			{if $topic.adviser_validation eq 'n'}
			<tr>
				<td style="width:30mm;border: 1px solid blue;text-align:center;">{$topic.owner_validation_date|date_format:"%d/%m/%Y"}</td>
				<td style="width:125mm;border: 1px solid blue;">{$topic.label}</td>
				<td style="width:30mm;border: 1px solid blue;text-align:center;">P</td>
			</tr>
			{/if}
		{/if}
	{/foreach}
	<tr>
		<td style="border: 1px solid blue;text-align:center; color: blue; font-weight:bold;" colspan="3">
		Items validés uniquement par le Conseiller.
		</td>
	</tr>
	{foreach $project.allTopics as $topic}
		{if $topic.adviser_validation eq 'y' or $topic.adviser_validation eq 'i'}
			{if $topic.owner_validation eq 'n'}
			<tr>
				<td style="width:30mm;border: 1px solid blue;text-align:center;">{$topic.adviser_validation_date|date_format:"%d/%m/%Y"}</td>
				<td style="width:125mm;border: 1px solid blue;">{$topic.label}</td>
				<td style="width:30mm;border: 1px solid blue;text-align:center;">C</td>
			</tr>
			{/if}
		{/if}
	{/foreach}
	<tr>
		<td style="border: 1px solid blue;text-align:center; color: blue; font-weight:bold;" colspan="3">
		Items validés par le Porteur et le Conseiller.
		</td>
	</tr>
	{foreach $project.allTopics as $topic}
		{if $topic.adviser_validation eq 'y' or $topic.adviser_validation eq 'i'}
			{if $topic.owner_validation eq 'y' or $topic.owner_validation eq 'i'}
			<tr>
				<td style="width:30mm;border: 1px solid blue;text-align:center;">{$topic.adviser_validation_date|date_format:"%d/%m/%Y"}</td>
				<td style="width:125mm;border: 1px solid blue;">{$topic.label}</td>
				<td style="width:30mm;border: 1px solid blue;text-align:center;">P/C</td>
			</tr>
			{/if}
		{/if}
	{/foreach}
	</table><br /><br />
	<h2>Liste des objectifs non encore validés</h2><br />
	<table border="0" cellspacing="0">
	<thead>
	<tr>
		<th style='width:30mm;text-align:center;background-color:blue; color:white;'>Date</th>
		<th style='width:155mm;text-align:center;background-color:blue; color:white;'>Objectifs</th>
	</tr>
	</thead>
	{foreach $project.allTopics as $topic}
		{if $topic.adviser_validation eq 'n' and $topic.owner_validation eq 'n' and ($topic.objective eq 'y' or $topic.objective eq 'i')}
			<tr>
				<td style="width:30mm;border: 1px solid blue;text-align:center;">{$topic.objective_date|date_format:"%d/%m/%Y"}</td>
				<td style="width:157mm;border: 1px solid blue;">{$topic.label}</td>
			</tr>
		{/if}
	{/foreach}
	</table><br /><br /><br />
	<table style="width:190mm;" align="center" cellspacing="center" cellpadding="center">
		<tr>
			<td style="width:84mm;text-align:center;"  class="done">
				Signature Conseiller :<br />
				<br /><br /><br /><br /><br /><br />
			</td>
			<td style="width:2mm;">&nbsp;</td>
			<td style="width:84mm;text-align:center;" class="done">
				Signature Porteur :<br />
				<br /><br /><br /><br /><br /><br />
			</td>
		</tr>
	</table>
</page>
